package registry

// AgentServiceRegistration is used to register a new service
type ServiceRegistration struct {
	ID                string            `json:",omitempty"`
	Name              string            `json:",omitempty"`
	Tags              []string          `json:",omitempty"`
	Port              int               `json:",omitempty"`
	Address           string            `json:",omitempty"`
	EnableTagOverride bool              `json:",omitempty"`
	Meta              map[string]string `json:",omitempty"`
}

type registry interface {
	ServiceRegister(reg *ServiceRegistration) error
	ServiceDeregister(serviceID string) error
	Service(serviceID string) (*ServiceRegistration, error)
	Services(serviceName string) (*[]ServiceRegistration, error)
	PassTTL(nodeId string) error
}

type Client struct {
	Addr  string
	agent registry
}

func (this *Client) Agent() registry { return this.agent }
